﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BluSteamServer.Model.TransactionImplementation
{
    public class ChatTransaction : Transaction
    {
        private readonly string _sender;
        private readonly string _message;
        private readonly string _recipient;

        public ChatTransaction(string sender, string message, string recipient)
        {
            _sender = sender;
            _message = message;
            _recipient = recipient;
        }

        public void Validate()
        {
            // check if client is still connected
        }

        public void Execute()
        {
            string message = string.Format("$CP2011~SERVER~RESPONSE~CHAT~{0}~{1}", _sender, _message);
            Network.Send(_recipient, message);
        }
    }
}
